﻿using Microsoft.AspNetCore.Mvc;
using ZilLion.Service.Core.Domain.EntityBase;
using ZilLion.Service.WeChatMall.Domain.Responses.Appinfo;
using ZilLion.Service.WeChatMall.Domain.Services.Interface;

namespace ZilLion.Service.WeChatMall.Controllers
{
    /// <summary>
    ///     检查微商城jwt合法
    /// </summary>
    [Route("Api/WechatMall/App")]
    public class AppController : WechatMallControllerBase
    {
        private readonly IAppInfoService _appInfoService;

        public AppController(IAppInfoService appInfoService)
        {
            _appInfoService = appInfoService;
        }

        [Route("CheckJwt")]
        [HttpGet]
        public ResponseBase CheckJwt(string token = null)
        {
            return new ResponseBase();
        }

        [Route("GetAppInfo")]
        [HttpGet]
        public AppInfoResponse GetAppInfo(string token = null)
        {
            var appid = GetAppId();
            var dto = _appInfoService.GetAppByAppId(appid);
            return new AppInfoResponse {Appinfo = dto};
        }

       
    }
}